﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using S4Store.Domain.CarKpi;
using S4Store.Domain.AfterSaleKpi;

namespace S4Store.Models.AfterSaleCarKPI
{
    public class AfterSaleCarDecoratingListModel
    {
        public AfterSaleCarDecoratingListModel()
        {
            CarBrands = new List<Domain.CarBrand>();
            AfterSaleCarDecoratingMonthConfigs = new List<Domain.AfterSaleKpi.AfterSaleCarDecoratingMonthConfig>();
            AfterSaleCarDecoratingDayInputs = new List<AfterSaleCarDecoratingDayInput>();
        }

        public List<S4Store.Domain.CarBrand> CarBrands { get; set; }
        public IList<Domain.AfterSaleKpi.AfterSaleCarDecoratingMonthConfig> AfterSaleCarDecoratingMonthConfigs { get; set; }
        public IList<AfterSaleCarDecoratingDayInput> AfterSaleCarDecoratingDayInputs { get; set; }
        public bool isconfirmed { get; set; }
        public DateTime Date { get; set; }


        public AfterSaleCarDecoratingMonthConfig GetCarModelMonthConfig(int carmodelid)
        {
            var result = AfterSaleCarDecoratingMonthConfigs.FirstOrDefault(t => t.CarBrandId == carmodelid);
            if (result == null)
            {
                result = new Domain.AfterSaleKpi.AfterSaleCarDecoratingMonthConfig();
            }
            else
            {
                //result.Enble = true;
            }
            return result;
        }
    }
}